import axios from '@/utils/axios'

export default {
  get (url, params, headers) {
    let options = {}
    if (params) {
      options.params = params
    }
    if (headers) {
      options.headers = headers
    }
    return axios.get(url, options)
  },
  post (url, params, headers) {
    let options = {}
    if (headers) {
      options.headers = headers
    }
    return axios.post(url,params,options)
  },
  put  (url, params, headers) {
    let options = {}
    if (headers) {
      options.headers = headers
    }
    return axios.put(url, params, options)
  },
  delete (url, params, headers) {
    let options = {}
    if (headers) {
      options.headers = headers
    }
    return axios.delete(url,{data:params},options)
  }
}